package com.qyer.lxp.model.book.parameter;

import javax.xml.bind.annotation.*;
import java.io.Serializable;
import java.util.List;

/**
 * Created by jiangping on 16/7/1.
 */
@XmlRootElement(name = "book-request")
@XmlAccessorType(XmlAccessType.FIELD)
public class BookRequest implements Serializable{
    private static final long serialVersionUID = 6171480989223114039L;

    /**
     * 分销商订单 refers(必填)
     */
    @XmlElement(name = "distributor-order-refer")
    private String distributorOrderRefer;

    /**
     * 货币(必填)
     */
    private String currency;

    /**
     * 预订人姓名
     */
    @XmlElement(name = "booker-name")
    private String bookerName;

    /**
     * 预订人邮箱(必填)
     */
    @XmlElement(name = "booker-email")
    private String bookerEmail;

    /**
     * 预订人手机(必填)
     */
    @XmlElement(name = "booker-phone")
    private String bookerPhone;

    /**
     * 出票回调,订单确认成功后,会回调这个地址,
     * 参数是 order,value 是力行的 orderCd
     */
    @XmlElement(name = "callback-url")
    private String callbackUrl;

    /**
     * ￼表示是否需要力行检查当前请求的分销商订单号 refer 的唯一性。true
     * ￼时,如果已经存在这个 refer 对应的力行订单,那么本次预订请求失败
     */
    @XmlElement(name = "ensure-unique-order-refer")
    private boolean ensureUniqueOrderRefer;

    /**
     * 预订项集合
     */
    @XmlElementWrapper(name = "items")
    @XmlElement(name = "book-item")
    private List<BookItem> bookItem;

    public String getDistributorOrderRefer() {
        return distributorOrderRefer;
    }

    public void setDistributorOrderRefer(String distributorOrderRefer) {
        this.distributorOrderRefer = distributorOrderRefer;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getBookerName() {
        return bookerName;
    }

    public void setBookerName(String bookerName) {
        this.bookerName = bookerName;
    }

    public String getBookerEmail() {
        return bookerEmail;
    }

    public void setBookerEmail(String bookerEmail) {
        this.bookerEmail = bookerEmail;
    }

    public String getBookerPhone() {
        return bookerPhone;
    }

    public void setBookerPhone(String bookerPhone) {
        this.bookerPhone = bookerPhone;
    }

    public String getCallbackUrl() {
        return callbackUrl;
    }

    public void setCallbackUrl(String callbackUrl) {
        this.callbackUrl = callbackUrl;
    }

    public boolean isEnsureUniqueOrderRefer() {
        return ensureUniqueOrderRefer;
    }

    public void setEnsureUniqueOrderRefer(boolean ensureUniqueOrderRefer) {
        this.ensureUniqueOrderRefer = ensureUniqueOrderRefer;
    }

    public List<BookItem> getBookItem() {
        return bookItem;
    }

    public void setBookItem(List<BookItem> bookItem) {
        this.bookItem = bookItem;
    }

    @Override
    public String toString() {
        return "BookRequest{" +
                "distributorOrderRefer='" + distributorOrderRefer + '\'' +
                ", currency='" + currency + '\'' +
                ", bookerName='" + bookerName + '\'' +
                ", bookerEmail='" + bookerEmail + '\'' +
                ", bookerPhone='" + bookerPhone + '\'' +
                ", callbackUrl='" + callbackUrl + '\'' +
                ", ensureUniqueOrderRefer=" + ensureUniqueOrderRefer +
                ", bookItem=" + bookItem +
                '}';
    }
}
